<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <title>图片上传 - 单文件</title>
    <script src="./jquery.js"></script>
    <script src="./xgUpImg.js"></script>
</head>
<body>
    <input type="file" accept="image/*;capture=camera" class="input" id="input">
    <script>
	var upload = new UploadPic();
	//监听上传文件动作
	$('#input').change(function(e){
		console.log('file->',e.target.files);
		upload._getBase64(e.target.files,getBase64);
	});
	//执行上传回调
	function getBase64(filesBase64){
		console.log('上传回调',filesBase64);
		$.ajax({
            url: "upload.php", //小官提示-修改这里
            data: { files: filesBase64 },
            type: 'post',
            dataType: 'json',
            success: function(i) {
                console.log(i);
            }
        })
	}
    </script>
</body>

</html>